﻿namespace OasisCiq.Xpil
{
    using System.Collections.Specialized;
    using CommonTypes;
    using External;
    using XS;

    /// <summary>
    /// Revenue/Income details
    /// </summary>
    public class Revenue : XSDecimal, IDataQualityGroup, IExtendedAttributes
    {
        public Revenue(decimal value) 
            : base(value)
        {
        }

        public Revenue(string value) 
            : base(value)
        {
        }

        /// <summary>
        /// A three-letter currency code as per ISO 4217
        /// </summary>
        public RevenueCurrencyCodeList CurrencyCode { get; set; }

        /// <summary>
        /// Status of the entity. e.g. Old, Current, Inactive, Active, etc
        /// </summary>
        public StatusList Status { get; set; }

        /// <summary>
        /// Begining of the period. Inclusive.
        /// </summary>
        public XSDateTime PeriodFrom { get; set; }

        /// <summary>
        /// End of the period. Inclusive.
        /// </summary>
        public XSDateTime PeriodTo { get; set; }

        /// <summary>
        /// Defines the type of amount. Example: 
        /// Total earning, profit, loss, turnover, etc.
        /// </summary>
        public RevenueTypeList Type { get; set; }

        /// <summary>
        /// Precision range where the value of the 
        /// element is in the middle of the range.
        /// Note minimum value is 0
        /// </summary>
        public XSDecimal Precision { get; set; }

        /// <summary>
        /// Where this revenue / income comes from, 
        /// e.g. business stream, activity, etc.
        /// </summary>
        public RevenueSourceList Source { get; set; }

        /// <summary>
        /// Country from where the revenue is generated
        /// </summary>
        public CTString CountryName { get; set; }

        /// <summary>
        /// If present and set to true indicates that the 
        /// income / revenue is after tax.
        /// </summary>
        public XSBoolean AfterTax { get; set; }

        /// <summary>
        /// This attribute indicates what level of trust can be given to the parent element.
        /// Omit this attribute if the data quality is unknown. If the data quality is known,
        /// the value is "Valid, else "InValid"
        /// </summary>
        public DataQualityTypeList DataQualityType { get; set; }

        /// <summary>
        /// Date the data quality is valid from
        /// </summary>
        public XSDateTime ValidFrom { get; set; }

        /// <summary>
        /// Date the data quality is valid to
        /// </summary>
        public XSDateTime ValidTo { get; set; }

        public NameValueCollection ExtendedAttributes { get; set; }
    }
}
